<extend name="Public/Common/base.html" />
<block name="main">
<style>
.layui-form-label{
	width:110px !important;
	
	
}
</style>
<css  href="__PUBLIC__/layui/css/layui.css"  media="all"/>

  <form class="layui-form" action="{$url}" method="post" >
   <input type="hidden" name="id" value="<notempty name="editinfo.id">{$editinfo.id}</notempty>">	
  <div class="layui-form-item">
    <label class="layui-form-label">管理员：</label>
    <div class="layui-input-block">
      <input type="text"  name="name" lay-verify="name" value="<notempty name="editinfo.name">{$editinfo.name}</notempty>" autocomplete="off" placeholder="请输入姓名" class="layui-input">
    </div>
  </div>
  
   <div class="layui-form-item">
    <label class="layui-form-label">密码:</label>
    <div class="layui-input-block">
      <input type="password" name="password" lay-verify="password" value="<notempty name="editinfo.password">{$editinfo.password}</notempty>"  placeholder="请输入密码" autocomplete="off" class="layui-input">
    </div>
  </div>
  
   <div class="layui-form-item">
    <label class="layui-form-label">确认密码：</label>
    <div class="layui-input-block">
      <input type="password"  name="repassword" lay-verify="repassword"  value="<notempty name="editinfo.password">{$editinfo.password}</notempty>" autocomplete="off" placeholder="确认密码" class="layui-input">
    </div>
  </div>
 
   <div class="layui-form-item">
      <label class="layui-form-label">所属角色：</label>
      <div class="layui-input-block">
        <select name="group_id" lay-verify="required" lay-search="">
          <option value="">请选择</option>
          <volist name="grouplist" id="vo">
          <option value="{$vo.id}" <eq name="vo.id" value="$groupId.group_id">selected</eq>>{$vo.title}</option>
          </volist>         
        </select>
      </div>
    </div> 
 
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="am-btn am-btn-primary" lay-submit="submit" >{$info}</button>   
    </div>
  </div>
  
</form>

   
<js  href="__PUBLIC__/layui/layui.js"  media="all"/>
<script>
layui.use(['form'], function(){
  var form = layui.form()
  ,layer = layui.layer  
  form.verify({
    name: function(value){
      if(value.length < 2){
        return '用户名至少得2个字符啊';
      }
    },
    password: function(value){
        if(value === ""){
        	return "密码不能为空！";
        }      
        var regExpDigital = /\d/; //如果有数字
	    var regExpLetters = /[a-zA-Z]/; //如果有字母
	    if (!(regExpDigital.test(value) && regExpLetters.test(value) && value.length >= 8)) {
	        return '密码必须包含英文和数字！';
	    }         
      },
      repassword: function(value) {
    	    if (value === "") {
    	    	 return "请输入二次密码！";
    	    }    	     
    	    var pwd = $('input[name=password').val();
    	    if (pwd !== value) {
    	    	  return "二次输入的密码不一致！";
    	    }
    	    
    	},
   	
  });  
});
</script>

        
      
</block>
